﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.IO;

namespace EvoSim
{
	public class Food : Entity
	{
		public double EnergyStorage = 60 * 60;

		public Food()
			: base("Food")
		{
			Radius = 8;
			EntityColor = Color.Green;
		}

		public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
		{
			base.Update(gameTime);

			if (EnergyStorage <= 0)
				Kill();
		}

		protected override void WriteInfo(BinaryWriter w)
		{
			base.WriteInfo(w);

			w.Write(EnergyStorage);
		}

		public override void Load(BinaryReader r, uint id)
		{
			base.Load(r, id);

			EnergyStorage = r.ReadDouble();
		}
	}
}
